<template>
	<view class="page">
		<view class="body">
			<view class="body_cont">
				<view class="body_cont_left">
					商家昵称
				</view>
				<view class="body_cont_right justify-content-start">
					{{seller_name}}
					<view class="copy_image" @click="copy()">
						<image src="../../static/index/copy.png" mode="" class="img"></image>
					</view>
				</view>
			</view>
			<view class="body_cont">
				<view class="body_cont_left">
					手机号
				</view>
				<view class="body_cont_right justify-content-start">
					{{seller_phone}}
					<view class="copy_image" @click="copy()">
						<image src="../../static/index/copy.png" mode="" class="img"></image>
					</view>
				</view>
			</view>
			<view class="body_cont">
				<view class="body_cont_left">
					机构名称
				</view>
				<view class="body_cont_right">
					{{institution_name}}
				</view>
			</view>
			<view class="body_cont">
				<view class="body_cont_left">
					机构证件号
				</view>
				<view class="body_cont_right ">
					{{institution_no}}
				</view>
			</view>
			<view class="body_cont">
				<view class="body_cont_left">
					默认费率
				</view>
				<view class="body_cont_right ">
					{{rates}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getIndex,
	} from '../../api/index/index.js'
	export default {
		data() {
			return {
				ordernum: '',
				orderamount: '',
				settlement: '',
				all_amount: '',
				statistical: '',
				rates: '',
				seller_name: '',
				seller_phone: '',
				institution_no: '',
				institution_name: ''
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			// 获取商家中心信息
			init() {
				getIndex().then(res => {
					this.ordernum = res.data.today_order_num;
					this.orderamount = res.data.today_order_total;
					this.settlement = res.data.today_no_settlement;
					this.seller_phone = res.data.mobile;
					this.all_amount = res.data.money;
					this.statistical = res.data.statistical;
					this.rates = res.data.rates;
					this.seller_name = res.data.shop_name;
					this.institution_name = res.data.institution_name;
					this.institution_no = res.data.institution_no;
				})
			},
			// 复制到剪贴板
			copy(e) {
				console.log(e);
				uni.setClipboardData({
					data: e,
					success: function() {
						console.log(e);
					}
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		height: 100%;

		.body {

			.body_cont {
				display: flex;
				justify-content: space-between;
				padding: 10px 0;
				line-height: 35px;
				border-bottom: 1px solid #b2b2b2;

				.body_cont_left {
					color: #b2b2b2;
				}

				.body_cont_right {}

			}

		}
	}
</style>